<?php 

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: edit.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */

$this->headTitle($this->__('Configuration'));

/* @var $data Backend_Model_Entity_Config */
$data = $this->data;
?>
<div class="content-header" style="visibility: visible;">
    <table cellspacing="0">
       	<tr>
           	<td style="width: 50%;">
           		<h2 style="float:left" class="icon-head head-customer"><?php echo $this->__("Edit Configuration")?></h2>
           	</td>
           	<td class="form-buttons">
           		<input type="button" class="button" onclick='location.href="<?php echo $this->baseUrl('backend/configuration')?>";' value='<?php echo $this->__('Back') ?>'>
           		
           		<input type="button" class="button" onclick="$('#config_edit_form').submit()"  value='<?php echo $this->__('Save') ?>'/>
           	</td>
       	</tr>
    </table>
</div>

<form id="config_edit_form" method="post"
	action="<?php echo $this->baseUrl('default/configuration/save-edit')?>" >
	<?php if($data->getId()){?>
   	<input type="hidden" name="data[id]" id="id" value="<?php echo $data->getId()?>" />   		
   	<?php }?> 
	<div class="info_tabs_set_content">
		<div class="entry-edit">
		    <div class="entry-edit-head">
		    	<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Edit Configuration Settings') ?></h4>
		    	<div class="form-buttons"></div>
			</div>
		    <div id="settings" class="fieldset ">
			    <div class="hor-scroll">
				    <table cellspacing="0" class="normal">
		                <tr>
		        			<td class="label"><label for="mf"><?php echo $this->escape($data->getTitle())?></label></td>
		    				<td class="value">
				    			<?php 
				    				$input = $data->getInput();
				    				switch ($input){
				    					case 'text':	
				    						?>	
				    						 <input type="text" name="data[value]" id="<?php echo $data->getCode()?>" class="mf <?php echo $data->getValidation() ?>" value="<?php echo $this->escape($data->getValue())?>" />	
				    						<?php     					
				    						break;
				    					case 'textarea':
				    						break;
				    					case 'checkbox':
				    						break;
				    					case 'radio':
				    						break;
				    					case 'select':
				    						$options = $data->getOptionsArray();
				    						echo $this->formSelect("data[value]",$this->escape($data->getValue()),array("id"=>$data->getCode(),"class"=>$data->getValidation()),$options);
				    						break;
				    				}
				    			?>	
			    			</td>
		    				<td class="description"></td>
		    			</tr>		    														
				    </table>
			     </div>
		     </div>
		</div>
	</div>
	<div style="clear:both;"></div>
</form>
